home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------ query_calls.c -------------------------------*/
- /* Copyright 1989 Brown University -- Jeffrey Vogel */
- /*----------------------------------------------------------------------------*/
-
- /*--------------------------------- Includes ---------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- #include "qd_local.h"
-
-
-
-
- /*---------------------------------- Button ----------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- Boolean
- Button()
- {
- Window child, root;
- int rx, ry, x, y;
- unsigned int keys, mask;
- XWindowAttributes atts;
-
- /*** error checks ***/
- if (!QDrunning) {
- QDerror("ERROR Button: QuickDraw not initialized.");
- return FALSE;
- }
-
- /*** make sure we have the latest sizes ***/
- XGetWindowAttributes(QDdisplay, QDwindow, &atts);
- QDwidth = atts.width;
- QDheight = atts.height;
-
- mask = (Button1Mask|Button2Mask|Button3Mask);
- XQueryPointer(QDdisplay, QDwindow, &root,
- &child, &rx, &ry, &x, &y, &keys);
- if ((x < 0) || (y < 0) || (x > QDwidth) || (y > QDheight))
- return FALSE;
- else
- return ((keys & mask) != 0);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /*--------------------------------- GetMouse ---------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- void
- GetMouse(x, y)
- int *x, *y;
- {
- Window child, root;
- int rx, ry;
- unsigned int keys;
-
- /*** error checks ***/
- if (!QDrunning) {
- QDerror("ERROR GetMouse: QuickDraw not initialized.");
- return;
- }
-
- XQueryPointer(QDdisplay, QDwindow, &root,
- &child, &rx, &ry, x, y, &keys);
- }
-
- /*-------------------------------- GetMousePt --------------------------------*/
- /*----------------------------------------------------------------------------*/
-
- void
- GetMousePt(pt)
- Point *pt;
- {
- Window child, root;
- int rx, ry;
- unsigned int keys;
-
- /*** error checks ***/
- if (!QDrunning) {
- QDerror("ERROR GetMousePt: QuickDraw not initialized.");
- return;
- }
-
- XQueryPointer(QDdisplay, QDwindow, &root,
- &child, &rx, &ry, &(pt->x), &(pt->y), &keys);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-